function [post act] = kmeanspostRobust(mix, data)


K = mix.ncentres;
N = size(data.Y, 1);

[act logact] = kmeansactivRobust(mix, data);
log_priors = log(mix.priors);

logpost = ones(N, 1)*log_priors + logact;
max_logpost = max(logpost, [], 2);
logpost = logpost - max_logpost*ones(1, K);

post = exp(logpost);
post = post./(sum(post, 2)*ones(1, K));
